package com.tengju.motivation.domain.model.activity;

public enum ActivityTargetSaleType {

    MONEY_OUT(10, "出货额"),
    MONEY_PAY(20,  "实付额"),;

    private final Integer val;
    private final String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    ActivityTargetSaleType(Integer val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    public static ActivityTargetSaleType fromVal(Integer val) {
        for (ActivityTargetSaleType type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }

    public static ActivityTargetSaleType fromName(String name) {
        for (ActivityTargetSaleType type : values()) {
            if (type.name().equals(name)) {
                return type;
            }
        }
        return null;
    }

}
